package test.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Util {
	
	public String emptyValue(String inpString) {
		if (inpString.contentEquals("")) {
			return "[EMPTY]";
		} else {
			return inpString;
		}
	}
	
	public void sleep(int millisecond) {
		try {
			Thread.sleep(millisecond);
		} catch (Exception e) {
			System.err.println("Util.sleep:" + e.getMessage());
		}
    }
	
	public String dataTime2String(Date date, String mask) {
		 SimpleDateFormat format = new SimpleDateFormat(mask);
		 return format.format(date);
	}
	
	public String getTime(Date time) {
		return dataTime2String(time, "HH:mm:ss");
	}
}
